-module(msg).
-compile(export_all).


create_fail_msg(Pack) ->
 case  Pack of
  <<Flag:16/integer,From:32/binary,To:32/binary,Len:16/integer,Msg/binary>> ->
	<<11:16/integer,From:32/binary,To:32/binary,Len:16/integer,Msg/binary>>;
  Any ->
	<<0>>
  end.

create_fail_msg(From,To,Len,Msg) ->
	<<11:16/integer,From:32/binary,To:32/binary,Len:16/integer,Msg/binary>>.

create_fail_online(Pack)->
 case Pack of
  <<0:16/integer,User/binary>>->
    <<65535:16/integer,User/binary>>;
  _Any ->
    <<0>>
 end.